<template>
  <div>
    <h1 ref="hRef">我是测试ref的</h1>
    <Son ref="SonRef"></Son>
  </div>
</template>

<script>
import { ref, onMounted } from 'vue'
import Son from './components/Son.vue'
export default {
  components: {
    Son
  },
  setup () {
    const hRef = ref(null)
    const SonRef = ref(null)
    // console.log(hRef)
    // hRef.value.style.color= 'red'
    onMounted(() => {
      console.log(hRef)
      hRef.value.style.color= 'red'
      console.log(SonRef)
      SonRef.value.sayHi()
    })
    return {
      hRef,
      SonRef
    }
  }
}
</script>

<style>

</style>
